﻿@model StoryTellerSite.Models.MessageModel
@if (Model.Count() > 0)
{
    switch (Model.Alert)
    {
        case StoryTellerSite.Models.AlertType.Error:
            
            

    <div class="alert alert-danger alert-dismissable">
        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">
            &times;</button>
        @Model.FirstOrDefault();
    </div>       
   break;
        case StoryTellerSite.Models.AlertType.Success:
    <div class="alert alert-success  alert-dismissable">
        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">
            &times;</button>
        @Model.FirstOrDefault();
    </div>
   break;
        case StoryTellerSite.Models.AlertType.Warning:
    <div class="alert alert-warning  alert-dismissable">
        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">
            &times;</button>
        @foreach (var item in Model.Text)
        {
            <p>@item</p>
        }
    </div>
        break;
    }
}
else
{
    throw new Exception("Chamando a partial de mensagem sem passar mensagens.");
}